<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition   xmlns="http://www.w3.org/1999/xhtml"
                  xmlns:h="http://java.sun.com/jsf/html"
                  xmlns:ui="http://java.sun.com/jsf/facelets"
                  xmlns:p="http://primefaces.prime.com.tr/ui"
                  xmlns:f="http://java.sun.com/jsf/core"
                  template="WEB-INF/facelets/template.xhtml">

    <ui:define name="content">
        <p:panel header="Administration">

        <h:form>

            <p:panel>
                <p>Album name: <h:inputText value="#{adminBackingBean.name}" required="true" validatorMessage="Must be at least 3 chars">
                        <f:validateLength minimum="3"/>
                    </h:inputText> </p>
                <p>Artist name: <h:inputText value="#{adminBackingBean.artist}" required="true" validatorMessage="Must be at least 3 chars">
                        <f:validateLength minimum="3"/>
                    </h:inputText> </p>
                <p>Album genre: <h:inputText value="#{adminBackingBean.genre}" required="true" validatorMessage="Must be at least 2 chars">
                        <f:validateLength minimum="2"/>
                    </h:inputText> </p>
                <p>Description: <h:inputText value="#{adminBackingBean.description}" required="true" validatorMessage="Must be less than 200 chars">
                        <f:validateLength maximum="200"/>
                    </h:inputText> </p>
                <p> Number of albums in stock: <h:inputText value="#{adminBackingBean.noInStock}" required="true">
                    </h:inputText> </p>
                <p>Album playtime: <h:inputText value="#{adminBackingBean.playtime}" required="true">
                    </h:inputText> </p>
                <p>Price: <h:inputText value="#{adminBackingBean.price}" required="true" validatorMessage="Must be at least 2 chars">
                        <f:validateLength minimum="2"/>
                    </h:inputText> </p>

            </p:panel>

            <h:commandButton value="Add Product" actionListener="#{adminControlBean.addCD}" action="refreshpage" />


        </h:form>
            
            </p:panel>

    </ui:define>


</ui:composition>
